﻿@model www.Models.FilesModel
@{
    Layout = null;
}
@if (Model.RelativePath != "" && Model.RelativePath != "/") {
    <div class="clsRow clsFolderRow clsParentDirectory clearfix" onclick="rootsync.files.openFolder('..')">
        <div class="clsFolderName">
            <a class="lnkFileName" href="javascript:$.noop()">..</a>
        </div>
    </div>
}
@foreach (DirectoryInfo dir in Model.Directories)
{
    <div class="clsRow clsFolderRow clearfix">
        <div style="float:left; width: auto; border-right: 1px #EDF1F5 solid; padding-right: 8px;">
            <input class="clsFolderCheckbox" type="checkbox" style="vertical-align:middle;" />
        </div>
        <div style="overflow: hidden;" onclick="rootsync.files.openFolder('@(ViewBag.path + dir.Name)')">
            <div class="clsFolderName" style="width: 100%;">
                <a class="lnkFileName" href="javascript:$.noop()">@dir.Name</a>
            </div>
        </div>
    </div>
}
@foreach (FileInfo file in Model.Files) { 
    <div style="display:block;" class="clsRow clsFileRow clearfix">
        <span class="spnFileRowCheckbox" style="border-right: 1px #EDF1F5 solid; padding-right: 8px;">
            <input class="clsFileCheckbox" style="vertical-align: middle;" type="checkbox" />
        </span>
        <a class="fileRowAnchor" style="" href="@Url.Action(Model.RelativePath + file.Name)" data-fileurl="@Url.Action(file.Name)">
            <span style="" class="spnFileName clsFileName">
                @file.Name
            </span>
            <span class="spnFileRowAttributes">
                <span class="spnFileSize clsFileSize">
                    @www.Core.Utility.FileSize(file.Length)
                </span>
                <span class="spnFileModified">
                    @file.LastWriteTime
                </span>
            </span>
        </a>
    </div>
    @*Html.ActionLink(file.Name, null, new { @path = ViewBag.path + file.Name })*@
}